package nl.zoidberg.calculon.cli;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import nl.zoidberg.calculon.engine.Board;
import nl.zoidberg.calculon.engine.ChessEngine;
import nl.zoidberg.calculon.notation.PGNUtils;

public class CommandLine {
	
	public static void main(String[] args) throws Exception {
		Board board = new Board().initialise();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s;
		while((s = br.readLine()) != null) {
			board.applyPgnMove(s);
			ChessEngine node = new ChessEngine();
			String move = node.getPreferredMove(board.getBitBoard());
			System.out.println(PGNUtils.translateMove(board, move));
			board.applyMove(move);
		}
	}
}
